package day3.problem3;

//除2
//https://ac.nowcoder.com/acm/problem/213140

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int k = scanner.nextInt();
        long[] arr = new long[n];
        for(int i = 0; i<n; i++) {
            arr[i] = scanner.nextInt();
        }
        long sum = 0;
        PriorityQueue<Long> queue = new PriorityQueue<>((a, b)->((int)(b-a)));
        for(long x : arr) {
            queue.add(x);
        }
        while(!queue.isEmpty() && k-- > 0) {
            while(!queue.isEmpty() && queue.peek() % 2 == 1) {
                sum += queue.poll();
            }
            if(!queue.isEmpty()) queue.add(queue.poll()/2);
        }
        while(!queue.isEmpty()) {
            sum += queue.poll();
        }
        System.out.println(sum);
    }
}